﻿using Dapper;
using System;
using BCEntity.Trading.Purchase.GoodsPurchaseCertificate;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading.Tasks;

namespace BCData.Trading.Purchase.GoodsPurchaseCertificate
{
    /// <summary>
    /// 商品采购单记账凭证
    /// </summary>
    public interface IGoodsPurchaseCertificateData
    {
        #region  成员方法
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="goodsPurchaseCertificateId">商品采购单记账凭证Id</param>
        Task<bool> Exists(long goodsPurchaseCertificateId);
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="certificateNo">凭证编号</param>
        Task<bool> Exists(string certificateNo);
        /// <summary>
        /// 增加商品采购单记账凭证
        /// </summary>
        /// <param name="entity">商品采购单记账凭证信息</param>
        Task<GoodsPurchaseCertificateEntity> Add(GoodsPurchaseCertificateEntity entity);
        /// <summary>
        /// 更新商品采购单记账凭证
        /// </summary>
        /// <param name="entity">商品采购单记账凭证信息</param>
        Task<GoodsPurchaseCertificateEntity> Update(GoodsPurchaseCertificateEntity entity);
        /// <summary>
        /// 删除商品采购单记账凭证
        /// </summary>
        /// <param name="goodsPurchaseCertificateId">商品采购单记账凭证Id</param>
        Task<bool> Delete(long goodsPurchaseCertificateId);
        /// <summary>
        /// 获取商品采购单记账凭证
        /// </summary>
        /// <param name="goodsPurchaseCertificateId">商品采购单记账凭证Id</param>
        Task<GoodsPurchaseCertificateEntity> GetEntity(long goodsPurchaseCertificateId);
        /// <summary>
        /// 获取商品采购单记账凭证列表
        /// </summary>
        /// <param name="goodsPurchaseId">商品采购单Id</param>
        Task<IEnumerable<GoodsPurchaseCertificateEntity>> GetList(long goodsPurchaseId);
        /// <summary>
        /// 获取商品采购单记账凭证分页列表
        /// </summary>
        /// <param name="goodsPurchaseId">商品采购单Id</param>
        /// <param name="certificateNo">凭证编号</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="sortName">排序字段</param>
        /// <param name="ascending">升序</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        Task<(IEnumerable<GoodsPurchaseCertificateEntity>, int)> Query(long? goodsPurchaseId, string certificateNo, DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);
        #endregion  成员方法
    }


}